﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WEEK11_上课演示._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>无标题页</title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:GridView ID="gridStudent" runat="server" Width="100%" 
                          AutoGenerateColumns="False" AllowPaging="True" 
                          onpageindexchanging="gridStudent_PageIndexChanging" 
                          onrowcommand="gridStudent_RowCommand" AllowSorting="True" 
                          onsorting="gridStudent_Sorting">
                <Columns>
                    <asp:BoundField HeaderText="序号" />
                    <asp:BoundField DataField="StudentID" HeaderText="学号" 
                                    SortExpression="StudentID" />
                    <asp:HyperLinkField runat="server" HeaderText="姓名" DataTextField="Name" 
                                        DataNavigateUrlFields="StudentID" 
                                        DataNavigateUrlFormatString="StudentDetails.aspx?id={0}"/>
                    <asp:BoundField DataField="Department" HeaderText="系"  />
               
                    <asp:ButtonField ButtonType="Image" CommandName="AddToCart" 
                                     ImageUrl="AddToCart.png" Text="购物车" />
                    <asp:ButtonField ButtonType="Image" CommandName="Buy" 
                                     ImageUrl="Buy.png" Text="购买" />
               
                </Columns>
            </asp:GridView>
            <asp:button ID="btnSort" runat="server" Text="排序" onclick="btnSort_Click" />
        </div>
    </form>
</body>